<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class NoteFilesResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        if(empty($this->resource)) return [];
        return [
            'pid'=>$this->pid,
            'fileName'=>$this->title,
            'size'=>$this->fsize,
            'ext'=>$this->hz,
            'fileUrl'=>$this->furl,
            'fdir'=>$this->fdir,
            'is_del'=>$this->is_del,
            'is_edit'=>$this->is_edit,
            'uid'=>$this->uid,
        ];
    }
}
